{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "0cfa3108",
   "metadata": {},
   "source": [
    "# IIR滤波器结构：并联型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "f6eee17f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbgAAAEoCAYAAAAqrOTwAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAiLUlEQVR4nO3df5RU9X3/8eeLdSEb+OJi2ZiwDaKtYq1K8eyxEo0lVsUYkxDy9WhjalOTA7GpPR4bjES/LbX+SkjzR2O0YtQkVok/voRvUpODv0LUHoku2SiayMkPBbtIBHEl6ApkeX//uHdhWGZ29w6zOzN3Xo9z9pyZO5975325w7zmc+/n3quIwMzMLG/GVLsAMzOzkeCAMzOzXHLAmZlZLjngzMwslxxwZmaWSw44swYnSeW8ZlbrHHBmFSbp8AHPj5D05wOmNUkaU/BcksZK+kTBtMsljS94/k5JBw1YztiCx++V1Jmx1vOASwZpcknaxqzuOODMUpK+Kemzg02TtFjSdkmvSuqW9I8D2r8D+LGkjxVMvgj48oC3+yjwsqQXJD0D/JYkaD4q6UxJxwIfB3oL5rkaeF7SBklPSHobuEvSqZLuAnakf0j6lKRvDrG+U4EFwH8M0uwW4GJJhw22LLNa5IAzy+7GiHgXcDLwBUkzANLe1U7gMuAzBe0/DFyX9tqaASJiOXArsJgkZH4A3A+sBjqALwKPpPOSzvP5tP2twGxgU0Scm77nLmA3kOXKDVcDn4+InaUaRMQOYCHwLxmWa1YTDhq6iZkVExEvSVoNTAeeAb4CfAgYBxws6YW06XtIQmkH8E3g2oLFXEsSUD8BWoC3gD8GJgIvAO8CkDQNOJsk/A4m6RVOkHQx8HLW2iWNAw6LiJ8OYz2fTnezjksDz6wuuAdnVqZ0F18HsA4gIi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RsfwYag6SLgevY21O5A7gMb/fcSweW3QuMA54DFgGPkWHb12XAwZ6VPwN4LCI2VbseG33+DDQmb/fGlXXb123AmZmZDaZej8GZmZkNygFnZma55IAzM7NccsCZmVkuOeDMzCyX/j9MZsIOHupHVQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#libraries\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from scipy import signal\n",
    "\n",
    "#parameters of defference equation\n",
    "b = np.array([[-13.65,-14.81,0],[32.6,-16.37,0]]) #numerator\n",
    "a = np.array([[1,-2.95,3.14],[1,-1,0.5]]) #denominator\n",
    "\n",
    "#input signal\n",
    "M = a.shape[0];N = 30\n",
    "delta = signal.unit_impulse(N) #unit sample signal\n",
    "y = np.ones(N) #unit step signal\n",
    "\n",
    "#IIR parfilter\n",
    "z1 = np.zeros((M,N));z2 = np.zeros((M,N));\n",
    "for i in range(M): #分别通过M个滤波器，计算最终结果\n",
    "    zi = signal.lfilter_zi(b[i,:],a[i,:])*0 #zero initial condition\n",
    "    z1[i,:],_ = signal.lfilter(b[i,:],a[i,:],delta,zi=zi);\n",
    "    z2[i,:],_ = signal.lfilter(b[i,:],a[i,:],y,zi=zi);\n",
    "\n",
    "#plot\n",
    "fig,axs = plt.subplots(2,1,constrained_layout=True)\n",
    "axs[0].stem(np.sum(z1,axis=0),basefmt=\"\")\n",
    "axs[1].stem(np.sum(z2,axis=0),basefmt=\"\")\n",
    "plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签\n",
    "axs[0].set_title('IIR并联型h(n)');axs[1].set_title('IIR并联型y(n)')\n",
    "plt.show();fig.savefig('./iir_par_sequence.png',dpi=500)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "99688a7e",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
